﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ex3.FindStudents
{
    class FindStudents
    {
        class Student
        {
            public string FirstName { get; set; }
            public string LastName { get; set; }
        }

        static IEnumerable<Student> FilterStudents(Student[] students)
        {
            var filteredStudents =
                from student in students
                where student.FirstName.CompareTo(student.LastName) < 0
                select student;
            return filteredStudents;
        }

        static void Main(string[] args)
        {
            Student[] students = new Student[] 
                                        { 
                                            new Student { FirstName = "Alex", LastName = "Buchkov" } ,
                                            new Student { FirstName = "Bobi", LastName = "Cickov" } ,
                                            new Student { FirstName = "Lisa", LastName = "Kirova" } ,
                                        };
            var filteredStudents = FilterStudents(students);
            foreach (var student in filteredStudents)
            {
                Console.WriteLine("{0,-10}{1,-10}",student.FirstName,student.LastName);
            }
        }

    }
}
